/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.swta;

import java.io.Serializable;
import org.apache.wicket.IClusterable;

/**
 *
 * @author JKorreck
 */
public class MyItem implements Serializable, IClusterable {

    private String id;
    private String category;
    private String name;
    private int weight;
    private String unit;
    private int count;
    private double price;

    public MyItem() {
    }

    public MyItem(String id, String category, String name, int weight, String unit, double price) {
        this.id = id;
        this.category = category;
        this.name = name;
        this.weight = weight;
        this.unit = unit;
        this.count = 0;
        this.price = price;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        if (count >= 0) {
            this.count = count;
        }
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

//    @Override
//    public boolean equals(Object obj) {
//
//        boolean test = false;
//
//        if (obj != null) {
//            if (obj instanceof MyItem) {
//                test = this.getId().equals(((MyItem) obj).getId());
//            }
//        }
//        return test;
//    }

    @Override
    public String toString() {
        return "Item: " + this.getName() + " (" +
                this.getId() + ")";
    }
}
